package com.ruoyi.dynamic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.dynamic.mapper.RoomVoteRecordMapper;
import com.ruoyi.dynamic.model.pojo.entity.RoomVoteRecord;
import com.ruoyi.dynamic.service.IRoomVoteRecordService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Date;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Gnc
 * @since 2025-01-02
 */
@Service
public class RoomVoteRecordServiceImpl extends ServiceImpl<RoomVoteRecordMapper, RoomVoteRecord> implements IRoomVoteRecordService {


    @Override
    public void addRecord(Long roomId, Long roomVoteId, Long giftId, String giftImg, BigDecimal giftPrice, String voteContent, Long userId, String giftName) {
        RoomVoteRecord record = new RoomVoteRecord();
        record.setGiftId(giftId);
        record.setRoomId(roomId);
        record.setUserId(userId);
        record.setRoomVoteId(roomVoteId);
        record.setVoteContent(voteContent);
        record.setCreateTime(new Date());
        record.setGiftName(giftName);
        record.setGiftImg(giftImg);
        record.setGiftPrice(giftPrice);
        save(record);
    }
}
